package com.ztgf.order.api.client;

import com.ztgf.common.constant.Result;
import com.ztgf.order.models.bo.OrderContractCenterBO;
import com.ztgf.order.models.service.IOrderContractRelationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 订单合同关系表控制器
 *
 * @author chenyu.wang
 * @Date 2020-06-03 15:58:52
 */

@RestController
@RequestMapping("/api/orderContractRelation")
@Slf4j
@Api(value = "OrderContractRelationApiController", tags = "订单合同关系表Api接口")
public class OrderContractRelationApiController {

    @DubboReference
    private IOrderContractRelationService orderContractRelationService;

//    @PostMapping(value = "/insert")
//    @ApiOperation(value = "添加订单合同", notes = "添加订单合同")
//    public Result insertBrandInfo(OrderContractRelationSaveBO saveBO) {
//        boolean flag = orderContractRelationService.add(saveBO);
//        if (flag) {
//            return new Result<>();
//        } else {
//            return new Result<>(CodeEnum.FAIL_100007);
//        }
//    }

    @PostMapping(value = "/queryMyContractList")
    @ApiOperation(value = "个人中心，我的合同列表", notes = "个人中心，我的合同列表")
    public Result queryMyContractList(OrderContractCenterBO bo,Integer contactType) {
        return new Result<>(orderContractRelationService.queryMyContractList(bo,contactType));
    }

}
